﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace EasyChat_Server.Log4net
{
    public static class log
    {
        public static void logwrite(string as_in, string as_out)
        {

            string ls_file;

            ls_file ="log//"+ DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".txt";

            ////FileInfo myFile = new FileInfo(ls_file);
            ////StreamWriter sw5 = myFile.CreateText();
            ////sw5.WriteLine(as_in);
            ////sw5.WriteLine(as_out);

            ////sw5.Close();

            string str1 = as_in + "\r\n" + as_out;
            using (StreamWriter sw = new StreamWriter(ls_file, true))
            {

                sw.WriteLine(str1);
                sw.Flush();
                //关闭写数据流 
                sw.Close(); 
            }



            //DateTime now = DateTime.Now;
            //string s = now.ToString("yyyyMMddHHmmssffff ");
            //using (StreamWriter sw = new StreamWriter(fileName, true))
            //{


            //    sw.WriteLine("["+s+"]"+message+"\n");
            //    sw.Flush();
            //    //关闭写数据流 
            //    sw.Close(); 

        }

    }
}

